package com.javabaas.server.novel_server.common;

import javax.servlet.http.HttpServletResponse;

public enum StatusCode {

    STATUS_OK(0, "ok"),
    STATUS_PLATFORM_ERROR(6, "请求头中Plat信息错误"),
    STATUS_DUPLICATE_KEY_EXCEPTION(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "数据库unique字段的值重复"),
    STATUS_SC_INTERNAL_SERVER_ERROR(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "exception error"),
    STATUS_SC_METHOD_NOT_ALLOWED(HttpServletResponse.SC_METHOD_NOT_ALLOWED, "不支持当前请求方法"),
    STATUS_SC_BAD_REQUEST(HttpServletResponse.SC_BAD_REQUEST, "bad request"),
    STATUS_SC_UNSUPPORTED_MEDIA_TYPE(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, "不支持当前媒体类型"),
    STATUS_SC_UNAUTHORIZED(HttpServletResponse.SC_UNAUTHORIZED, "签名错误"),

    //设备安装
    STATUS_INSTALLATION_WRONG_PARAMS(100, "参数错误"),

    //短信服务
    STATUS_SMS_PHONE_ILLEGAL(100, "非法的手机号"),
    STATUS_SMS_CODE_EXPIRE(101, "验证码已过期"),
    STATUS_SMS_CODE_WRONG(102, "验证码错"),
    STATUS_SMS_PHONE_EMPTY(103, "手机号为空"),
    STATUS_SMS_CODE_EMPTY(104, "验证码为空"),

    //邮箱
    STATUS_MAIL_EMPTY(100, "邮箱是空"),
    STATUS_MAIL_ILLEGAL(101, "邮箱非法"),
    STATUS_MAIL_EXPIRE(102, "验证码已过期"),
    STATUS_MAIL_WRONG(103, "验证码错"),

    //book
    STATUS_BOOKS_EMPTY(100, "books is null"),

    //chapter
    STATUS_BOOKID_EMPTY(100, "bookId is null"),

    //book
    STATUS_SEARCH_TEXT_EMPTY(100, "searchText is null"),
    STATUS_MAIOR_TEXT_EMPTY(101, "maior is null"),


    //用户相关
    STATUS_USER_UNLOGIN(100, "用户未登录"),
    STATUS_USER_ILLEGAL(101, "非法用户"),
    STATUS_USER_TOKEN_ERROR(102, "user: token error"),
    STATUS_USER_EMPTY_USERNAME(103, "用户名不能为空"),
    STATUS_USER_EMPTY_PASSWORD(104, "密码不能为空"),
    STATUS_USER_WRONG_PASSWORD(105, "密码错误"),
    STATUS_USER_ALREADY_EXIST(106, "用户名已存在"),
    STATUS_USER_INVALID_USERNAME(107, "用户名非法 用户名只能包含数字字母 _ @ ."),
    STATUS_USER_NOT_EXIST(108, "改用户不存在");

    private String msg;
    private int code;

    StatusCode(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }




}
